<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>商品获取填写信息表单HTML页面</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link rel="shortcut icon" href="../img/favicon_2.ico">
    <link rel="stylesheet" href="../css/base.css">
    <link rel="stylesheet" href="../css/admin.css">
    <!--1954-->
    <link rel="stylesheet" href="../layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../css/acouadd.css">
    <link type="text/css" href="css/grachange.css" rel="stylesheet">
    <style>
        button {
            background: transparent;
            width: 200px;
            padding: 1em;
            margin-bottom: 2em;
            border: none;
            border-left: 1px solid rgba(255, 255, 255, 0.3);
            border-top: 1px solid rgba(255, 255, 255, 0.3);
            border-radius: 5000px;
            -webkit-backdrop-filter: blur(5px);
            backdrop-filter: blur(5px);
            box-shadow: 4px 4px 60px rgba(0, 0, 0, 0.2);
            color: #fff;
            font-family: Montserrat, sans-serif;
            font-weight: 500;
            -webkit-transition: all 0.2s ease-in-out;
            transition: all 0.2s ease-in-out;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
        }

        .layui-upload-drag {
            position: relative;
            border: 1px dashed #e2e2e2;
            opacity: 0.4;
            text-align: center;
            cursor: pointer;
            color: #999;
        }
    </style>
    <link id="layuicss-layer" rel="stylesheet"
          href="http://localhost:63343/qiguai/layui/css/modules/layer/default/layer.css?v=3.1.1" media="all">
</head>
<body style="">
<!--<div class="left_nav">-->
    <!--<div class="left_aftsale"></div>-->
    <!--<div class="right">-->
        <!--<div class="search_txt font_family">查找</div>-->
        <!--<input type="text">-->
        <!--<div class="work">-->
            <!--<ul>-->
                <!--<li>-->
                    <!--<div class="txtf">项目</div>-->
                    <!--<div class="imgf"></div>-->
                    <!--<div class="png1"></div>-->
                <!--</li>-->
                <!--<li>-->
                    <!--<div class="txt">物流管理</div>-->
                    <!--<div class="png2"></div>-->
                <!--</li>-->
                <!--<li>-->
                    <!--<div class="txt">优惠券管理</div>-->
                    <!--<div class="png3"></div>-->
                <!--</li>-->
                <!--<li>-->
                    <!--<div class="txt">用户关联优惠券</div>-->
                    <!--<div class="png4"></div>-->
                <!--</li>-->
                <!--<li>-->
                    <!--<div class="txt">售后管理</div>-->
                <!--</li>-->
            <!--</ul>-->
        <!--</div>-->
    <!--</div>-->
<!--</div>-->
<!--更改-->
<div class="header">
    <div class="ht">
        <div class="title_name">惠券添加</div>
    </div>
</div>
<div class="content">
    <div class="container">
        <form class="layui-form" enctype="multipart/form-data" method="post" style="margin-top:30px"
              action="http://localhost:8080/admin/couadderr">
            <!--<form class="layui-form" action="/" lay-filter="myDiv" enctype="multipart/form-data" method="post"-->
            <!--id="signupForm">-->
            <div class="d1">
                <input type="text" name="couMoney" placeholder="面额" lay-verify="required" autocomplete="off"><br>
                <input type="text" name="couHolding" placeholder="有效时长" lay-verify="required" autocomplete="off"><br>
                <input type="text" name="couponType" placeholder="类型" lay-verify="required" autocomplete="off"><br>
                <button lay-submit="" lay-filter="formDemo">开始上传</button>
                <br>
            </div>
            <div class="d2">
                <div class="layui-upload-drag" id="upphoto1">
                    <i class="layui-icon"></i>
                    <p>点击上传，或将文件拖拽到此处</p>
                    <div class="layui-hide" id="uploadDemoView">
                        <hr>
                    </div>
                </div>
                <input class="layui-upload-file" type="file" accept="" name="file">
            </div>
            <img style="max-width: 200px; max-height:97px;" id="preview">
            <!--<p id="demoText"></p>-->
            <!--<div class="photobtn">-->
            <!--<div class="layui-form-item"></div>-->
            <!--<button type="button" class="layui-btn" lay-filter="formDemo" id="btn2">开始上传</button>-->
            <!--</div>-->
        </form>

        <div class="drops">
            <div class="drop drop-1"></div>
            <div class="drop drop-2"></div>
            <div class="drop drop-3"></div>
            <div class="drop drop-4"></div>
            <div class="drop drop-5"></div>
        </div>
    </div>
</div>

<script type="text/javascript" src="js/jquery.min.js"></script>
<script src="../js/jquery-3.3.1.min.js"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script src="../layui/layui.js" charset="utf-8"></script>
<script src="../js/acouadd.js"></script>
<script type="text/javascript" src="js/rangeslider.min.js"></script>
<script type="text/javascript">
    layui.use(['form', 'layer', 'upload'], function () {
        // var form = layui.form;
        var layer = layui.layer;
        var upload = layui.upload;
        var $ = layui.jquery;

        var code = location.search
        code = code.split("?")

        if (code[1] === "0") {
            layer.msg('上传成功')
        } else if (code[1] === "2") {
            layer.msg('上传失败,正在殴打技术猛男')
        } else if (code[1] === "3") {
            layer.msg('亲，请选择图片再上传嗷')
        }
        //拖拽上传
        upload.render({
            elem: '#upphoto1'
            , auto: false
            , bindAction: '#btn2'
            , exts: 'png|jpg|jpeg'
            //上传前的回调
            , choose: function (obj) {
                $('form').attr('action', 'http://localhost:8080/admin/acou')
                obj.preview(function (index, file, result) {
                    $('#preview').attr('src', result);
                })
            }
            , error: function () {
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-mini demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function () {
                    uploadInst.upload();
                });
            }
        })
    })
</script>

</body>
</html>